<template>
  <div class="page-header-index-wide">
    <div>
      <div>
        <div class="account-settings-info-left">
          <a-menu
            mode="horizontal"
            :selectedKeys="selectedKeys"
            type="inner"
            @openChange="onOpenChange"
            style="padding:8px 16px 0;"
          >
            <a-menu-item
              key="/educationalCenter/lessonTable/lessonTableTime"
              class="border-cantainer"
            >
              <router-link :to="{ name: 'lesson_table_time' }">
                <div class="border_catainer_bottom">时间课表</div>
              </router-link>
            </a-menu-item>
            <a-menu-item
              key="/educationalCenter/lessonTable/lessonTableTeacher"
              class="border-cantainer"
            >
              <router-link :to="{ name: 'lesson_table_teacher' }">
                <div class="border_catainer_bottom">老师课表</div>
              </router-link>
            </a-menu-item>
            <a-menu-item
              key="/educationalCenter/lessonTable/lessonTableClass"
              class="border-cantainer"
            >
              <router-link :to="{ name: 'lesson_table_class' }">
                <div class="border_catainer_bottom">教室课表</div>
              </router-link>
            </a-menu-item>
            <!-- <a-menu-item
              key="/educationalCenter/lessonTable/lessonTableMonth"
              class="border-cantainer"
            >
              <router-link :to="{ name: 'lesson_table_month' }">
                <div class="border_catainer_bottom">月课表</div>
              </router-link>
            </a-menu-item> -->
          </a-menu>
        </div>
        <div class="quittanceChildren">
          <route-view></route-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'

export default {
  components: {
    RouteView,
    PageView
  },
  mixins: [mixinDevice],
  data() {
    return {
      mode: 'inline',
      openKeys: [],
      selectedKeys: [],
      preview: {},
      option: {
        img: '/avatar2.jpg',
        info: true,
        size: 1,
        outputType: 'jpeg',
        canScale: false,
        autoCrop: true,
        // 只有自动截图开启 宽度高度才生效
        autoCropWidth: 180,
        autoCropHeight: 180,
        fixedBox: true,
        // 开启宽度和高度比例
        fixed: true,
        fixedNumber: [1, 1]
      },

      pageTitle: ''
    }
  },
  mounted() {
    this.updateMenu()
  },
  methods: {
    onOpenChange(openKeys) {
      this.openKeys = openKeys
    },
    updateMenu(to) {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
      if (this.selectedKeys[0] == '/educationalCenter/addCourse') {
        this.disPLAY_none = true
      } else {
        this.disPLAY_none = false
      }
    }
  },
  watch: {
    $route(val) {
      this.updateMenu()
    }
  }
}
</script>

<style lang="less">
.border-cantainer {
  padding: 0 10px;
  margin-right: 40px;
}

</style>
